package com.zjht.gmcc.servlet.provider;

import java.io.File;
import java.io.PrintWriter;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.fileupload.DiskFileUpload;
import org.apache.commons.fileupload.FileItem;

import com.zjht.gmcc.bean.BaseServlet;

import com.zjht.gmcc.bean.util.MyJDBC;
import com.zjht.gmcc.bean.util.MyPath;

public class EditProviderStatus extends BaseServlet {

	private static final long serialVersionUID = 2205937410942000119L;

	public boolean process(HttpServletRequest request, HttpServletResponse response, HttpSession session, PrintWriter out, MyJDBC myJDBC, String menu)
			throws Exception {
		int i_flag = 0;
		PreparedStatement ps;
		ResultSet rs;
		String s_msg="";
		String provid=request.getParameter("pid");
		String status=request.getParameter("status");
		
		String sql="update provider set status=? where  providerid=?";  
		ps=myJDBC.prepareStatement(sql);
		ps.setString(1, status);
		ps.setString(2, provid);
		i_flag=ps.executeUpdate();
		
			if (i_flag == 1) {
				alert(out, "供应商状态修改成功!","providerADM.jsp");
			} else {
				errAlert(request, out, menu, s_msg);
			}
			return i_flag == 1;
		

	}

}
